﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Web.View.d50_fymxMenu.Default" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>d50_fymx</title>
    <script src="/View/js/Alert.js" type="text/javascript"></script> 
    <script type="text/javascript">
        function SetWinData(index) {
            document.getElementById("Hid").value = d50_fymx_MainStore.getAt(index).get('zyid');
            
			Txtrowid.setValue(d50_fymx_MainStore.getAt(index).get('rowid'));
			Txtzyh.setValue(d50_fymx_MainStore.getAt(index).get('zyh'));
			Txtfyrq.setValue(d50_fymx_MainStore.getAt(index).get('fyrq'));
			Txtfyxh.setValue(d50_fymx_MainStore.getAt(index).get('fyxh'));
			Txtfymc.setValue(d50_fymx_MainStore.getAt(index).get('fymc'));
			Txtypcd.setValue(d50_fymx_MainStore.getAt(index).get('ypcd'));
			Txtypgg.setValue(d50_fymx_MainStore.getAt(index).get('ypgg'));
			Txtdw.setValue(d50_fymx_MainStore.getAt(index).get('dw'));
			Txtjx.setValue(d50_fymx_MainStore.getAt(index).get('jx'));
			Txtfysl.setValue(d50_fymx_MainStore.getAt(index).get('fysl'));
			Txtfydj.setValue(d50_fymx_MainStore.getAt(index).get('fydj'));
			Txtzjje.setValue(d50_fymx_MainStore.getAt(index).get('zjje'));
			Txtzfje.setValue(d50_fymx_MainStore.getAt(index).get('zfje'));
			Txtysgh.setValue(d50_fymx_MainStore.getAt(index).get('ysgh'));
			Txtsrgh.setValue(d50_fymx_MainStore.getAt(index).get('srgh'));
			Txtqrgh.setValue(d50_fymx_MainStore.getAt(index).get('qrgh'));
			Txtfybq.setValue(d50_fymx_MainStore.getAt(index).get('fybq'));
			Txtfyks.setValue(d50_fymx_MainStore.getAt(index).get('fyks'));
			Txtzxks.setValue(d50_fymx_MainStore.getAt(index).get('zxks'));
			Txtjfrq.setValue(d50_fymx_MainStore.getAt(index).get('jfrq'));
			Txtxmlx.setValue(d50_fymx_MainStore.getAt(index).get('xmlx'));
			Txtyplx.setValue(d50_fymx_MainStore.getAt(index).get('yplx'));
			Txtfylbid.setValue(d50_fymx_MainStore.getAt(index).get('fylbid'));
			Txtjscs.setValue(d50_fymx_MainStore.getAt(index).get('jscs'));
			Txtzfbl.setValue(d50_fymx_MainStore.getAt(index).get('zfbl'));
			Txtyzxh.setValue(d50_fymx_MainStore.getAt(index).get('yzxh'));
			Txthzrq.setValue(d50_fymx_MainStore.getAt(index).get('hzrq'));
			Txtyjrq.setValue(d50_fymx_MainStore.getAt(index).get('yjrq'));
			Txtzlje.setValue(d50_fymx_MainStore.getAt(index).get('zlje'));
			Txtzlxz.setValue(d50_fymx_MainStore.getAt(index).get('zlxz'));
			Txtbzxx.setValue(d50_fymx_MainStore.getAt(index).get('bzxx'));
			Txtgldm1.setValue(d50_fymx_MainStore.getAt(index).get('gldm1'));
			Txtgldm2.setValue(d50_fymx_MainStore.getAt(index).get('gldm2'));
			Txtgldm3.setValue(d50_fymx_MainStore.getAt(index).get('gldm3'));
			TxtNumsjzt.setValue(d50_fymx_MainStore.getAt(index).get('sjzt'));

            d50_fymx_Win.show();
        }
    </script>
</head>
<body>
    <form id="MainForm" runat="server">
    <ext:ResourceManager ID="MainResourceMgr" runat="server" />
    <!--用来导出到Excel的数据源-->
    <ext:Hidden ID="ExcelGridData" runat="server" />
    <!--d50_fymx表页面主数据元，自动生成-->
    <ext:Store runat="server" ID="d50_fymx_MainStore" OnRefreshData="d50_fymx_DataBind" AutoLoad="true">
        <Proxy>
            <ext:PageProxy />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="zyid">
                <Fields>
                    
					<ext:RecordField Name="zyid" />
					<ext:RecordField Name="rowid" />
					<ext:RecordField Name="zyh" />
					<ext:RecordField Name="fyrq" />
					<ext:RecordField Name="fyxh" />
					<ext:RecordField Name="fymc" />
					<ext:RecordField Name="ypcd" />
					<ext:RecordField Name="ypgg" />
					<ext:RecordField Name="dw" />
					<ext:RecordField Name="jx" />
					<ext:RecordField Name="fysl" />
					<ext:RecordField Name="fydj" />
					<ext:RecordField Name="zjje" />
					<ext:RecordField Name="zfje" />
					<ext:RecordField Name="ysgh" />
					<ext:RecordField Name="srgh" />
					<ext:RecordField Name="qrgh" />
					<ext:RecordField Name="fybq" />
					<ext:RecordField Name="fyks" />
					<ext:RecordField Name="zxks" />
					<ext:RecordField Name="jfrq" />
					<ext:RecordField Name="xmlx" />
					<ext:RecordField Name="yplx" />
					<ext:RecordField Name="fylbid" />
					<ext:RecordField Name="jscs" />
					<ext:RecordField Name="zfbl" />
					<ext:RecordField Name="yzxh" />
					<ext:RecordField Name="hzrq" />
					<ext:RecordField Name="yjrq" />
					<ext:RecordField Name="zlje" />
					<ext:RecordField Name="zlxz" />
					<ext:RecordField Name="bzxx" />
					<ext:RecordField Name="gldm1" />
					<ext:RecordField Name="gldm2" />
					<ext:RecordField Name="gldm3" />
					<ext:RecordField Name="sjzt" />

                </Fields>
            </ext:JsonReader>
        </Reader> 
        <BaseParams>
            <ext:Parameter Name="start" Value="0" Mode="Raw">
            </ext:Parameter>
            <ext:Parameter Name="limit" Value="15" Mode="Raw">
            </ext:Parameter>
        </BaseParams>
    </ext:Store>
    <!--d50_fymx页面主表格-->
    <ext:Viewport ID="MainViewPort" runat="server">
        <Items>
            <ext:FitLayout>
                <Items>
                    <ext:GridPanel ID="d50_fymx_Grid" Layout="fit" TrackMouseOver="true" runat="server" StoreID="d50_fymx_MainStore"
                        StripeRows="true" Header="false" Border="false" Collapsible="true">
                        <TopBar>
                            <ext:Toolbar ID="MainToolBar" runat="server">
                                <Items>
                                    <ext:Button ID="BtnAdd" runat="server" Text="添加" Icon="Add">
                                        <Listeners>
                                            <Click Handler="#{d50_fymx_MainForm}.getForm().reset();#{Hid}.setValue('');#{d50_fymx_Win}.show();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="BtnDel" runat="server" Text="删除" Icon="Delete">
                                        <DirectEvents>
                                            <Click OnEvent="BtnDel_Click">
                                                <Confirmation ConfirmRequest="true" Title="确认" Message="确实要删除吗?" />
                                                <EventMask ShowMask="true" Msg="正在删除数据，请等候 ..." />
                                            </Click>
                                        </DirectEvents>
                                        <Listeners>
                                            <Click Handler="if(#{d50_fymx_Grid}.getSelectionModel().getCount()<=0) {TellAlert('请选择要删除的记录');return false;}" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarSeparator />
                                    <ext:Button ID="BtnReload" runat="server" Text="重新加载" Icon="Reload">
                                        <Listeners>
                                            <Click Handler="#{d50_fymx_MainStore}.reload();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarFill />
                                    <ext:Button ID="BtnToExcel" runat="server" Text="To Excel" AutoPostBack="true" OnClick="BtnSaveToExcel"
                                        Icon="PageExcel">
                                        <Listeners>
                                            <Click Handler="#{ExcelGridData}.setValue(Ext.encode(d50_fymx_Grid.getRowsValues(false)));" />
                                        </Listeners>
                                        <ToolTips>
                                            <ext:ToolTip Title="将当前页内容存储为Excel文件">
                                            </ext:ToolTip>
                                        </ToolTips>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                        <ColumnModel ID="d50_fymx_ColumnMode" runat="server">
                            <Columns>
                                <ext:RowNumbererColumn Width="20" />
                                <ext:Column Header="主键" Sortable="true" Hidden="true" DataIndex="zyid" />
                                
								<ext:Column Header="ROWID" Sortable="true" DataIndex="rowid" />
								<ext:Column Header="ZYH" Sortable="true" DataIndex="zyh" />
								<ext:Column Header="FYRQ" Sortable="true" DataIndex="fyrq" />
								<ext:Column Header="FYXH" Sortable="true" DataIndex="fyxh" />
								<ext:Column Header="FYMC" Sortable="true" DataIndex="fymc" />
								<ext:Column Header="YPCD" Sortable="true" DataIndex="ypcd" />
								<ext:Column Header="ypgg" Sortable="true" DataIndex="ypgg" />
								<ext:Column Header="dw" Sortable="true" DataIndex="dw" />
								<ext:Column Header="jx" Sortable="true" DataIndex="jx" />
								<ext:Column Header="FYSL" Sortable="true" DataIndex="fysl" />
								<ext:Column Header="FYDJ" Sortable="true" DataIndex="fydj" />
								<ext:Column Header="ZJJE" Sortable="true" DataIndex="zjje" />
								<ext:Column Header="ZFJE" Sortable="true" DataIndex="zfje" />
								<ext:Column Header="YSGH" Sortable="true" DataIndex="ysgh" />
								<ext:Column Header="SRGH" Sortable="true" DataIndex="srgh" />
								<ext:Column Header="QRGH" Sortable="true" DataIndex="qrgh" />
								<ext:Column Header="FYBQ" Sortable="true" DataIndex="fybq" />
								<ext:Column Header="FYKS" Sortable="true" DataIndex="fyks" />
								<ext:Column Header="ZXKS" Sortable="true" DataIndex="zxks" />
								<ext:Column Header="JFRQ" Sortable="true" DataIndex="jfrq" />
								<ext:Column Header="XMLX" Sortable="true" DataIndex="xmlx" />
								<ext:Column Header="YPLX" Sortable="true" DataIndex="yplx" />
								<ext:Column Header="fylbid" Sortable="true" DataIndex="fylbid" />
								<ext:Column Header="JSCS" Sortable="true" DataIndex="jscs" />
								<ext:Column Header="ZFBL" Sortable="true" DataIndex="zfbl" />
								<ext:Column Header="YZXH" Sortable="true" DataIndex="yzxh" />
								<ext:Column Header="HZRQ" Sortable="true" DataIndex="hzrq" />
								<ext:Column Header="YJRQ" Sortable="true" DataIndex="yjrq" />
								<ext:Column Header="ZLJE" Sortable="true" DataIndex="zlje" />
								<ext:Column Header="ZLXZ" Sortable="true" DataIndex="zlxz" />
								<ext:Column Header="bzxx" Sortable="true" DataIndex="bzxx" />
								<ext:Column Header="gldm1" Sortable="true" DataIndex="gldm1" />
								<ext:Column Header="gldm2" Sortable="true" DataIndex="gldm2" />
								<ext:Column Header="gldm3" Sortable="true" DataIndex="gldm3" />
								<ext:Column Header="sjzt" Sortable="true" DataIndex="sjzt" />

                            </Columns>
                        </ColumnModel>
                        <Listeners>
                            <RowDblClick Handler="SetWinData(rowIndex);" />
                        </Listeners>
                        <Plugins>
                            <ext:GridFilters runat="server" FiltersText="查找" ID="d50_fymx_Filter">
                                <Filters>
                                    
								<ext:StringFilter DataIndex="rowid" />
								<ext:StringFilter DataIndex="zyh" />
								<ext:StringFilter DataIndex="fyrq" />
								<ext:StringFilter DataIndex="fyxh" />
								<ext:StringFilter DataIndex="fymc" />
								<ext:StringFilter DataIndex="ypcd" />
								<ext:StringFilter DataIndex="ypgg" />
								<ext:StringFilter DataIndex="dw" />
								<ext:StringFilter DataIndex="jx" />
								<ext:StringFilter DataIndex="fysl" />
								<ext:StringFilter DataIndex="fydj" />
								<ext:StringFilter DataIndex="zjje" />
								<ext:StringFilter DataIndex="zfje" />
								<ext:StringFilter DataIndex="ysgh" />
								<ext:StringFilter DataIndex="srgh" />
								<ext:StringFilter DataIndex="qrgh" />
								<ext:StringFilter DataIndex="fybq" />
								<ext:StringFilter DataIndex="fyks" />
								<ext:StringFilter DataIndex="zxks" />
								<ext:StringFilter DataIndex="jfrq" />
								<ext:StringFilter DataIndex="xmlx" />
								<ext:StringFilter DataIndex="yplx" />
								<ext:StringFilter DataIndex="fylbid" />
								<ext:StringFilter DataIndex="jscs" />
								<ext:StringFilter DataIndex="zfbl" />
								<ext:StringFilter DataIndex="yzxh" />
								<ext:StringFilter DataIndex="hzrq" />
								<ext:StringFilter DataIndex="yjrq" />
								<ext:StringFilter DataIndex="zlje" />
								<ext:StringFilter DataIndex="zlxz" />
								<ext:StringFilter DataIndex="bzxx" />
								<ext:StringFilter DataIndex="gldm1" />
								<ext:StringFilter DataIndex="gldm2" />
								<ext:StringFilter DataIndex="gldm3" />

                                </Filters>
                            </ext:GridFilters>
                        </Plugins>
                        <LoadMask ShowMask="true" Msg="正在加载..." />
                        <SelectionModel>
                            <ext:CheckboxSelectionModel ID="CheckBoxGrid" runat="server" />
                        </SelectionModel>
                        <BottomBar>
                            <ext:PagingToolbar ID="PagingToolBar" StoreID="d50_fymx_MainStore" PageSize="15" runat="server" />
                        </BottomBar>
                    </ext:GridPanel>
                </Items>
            </ext:FitLayout>
        </Items>
    </ext:Viewport>
    
    <!--d50_fymx表修改，添加主窗体-->
    <ext:Window ID="d50_fymx_Win" Collapsible="true" Hidden="true" Modal="true"
        Maximizable="true" runat="server" Title="添加/修改记录" Icon="WorldEdit" Width="630" AutoHeight="true"
        Resizable="true">
        <Items>
            <ext:Hidden ID="Hid" runat="server">
            </ext:Hidden>
            <ext:FormPanel ID="d50_fymx_MainForm" LabelWidth="65" Frame="true" runat="server"
                Border="false" Height="540" Padding="5" Icon="UserAdd" Layout="Column">
                <Items>
                    <ext:Panel runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form">
                        <Items>
                            
							<ext:TextField ID="Txtrowid" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ROWID" />
							<ext:TextField ID="Txtfyrq" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="FYRQ" />
							<ext:TextField ID="Txtfymc" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="FYMC" />
							<ext:TextField ID="Txtypgg" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ypgg" />
							<ext:TextField ID="Txtjx" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="jx" />
							<ext:TextField ID="Txtfydj" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="FYDJ" />
							<ext:TextField ID="Txtzfje" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ZFJE" />
							<ext:TextField ID="Txtsrgh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="SRGH" />
							<ext:TextField ID="Txtfybq" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="FYBQ" />
							<ext:TextField ID="Txtzxks" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ZXKS" />
							<ext:TextField ID="Txtxmlx" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="XMLX" />
							<ext:TextField ID="Txtfylbid" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="fylbid" />
							<ext:TextField ID="Txtzfbl" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ZFBL" />
							<ext:TextField ID="Txthzrq" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="HZRQ" />
							<ext:TextField ID="Txtzlje" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ZLJE" />
							<ext:TextField ID="Txtbzxx" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="bzxx" />
							<ext:TextField ID="Txtgldm2" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="gldm2" />
							<ext:NumberField ID="TxtNumsjzt" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="sjzt" />

                        </Items>
                    </ext:Panel>
                    <ext:Panel runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form">
                        <Items> 
                            
							<ext:TextField ID="Txtzyh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ZYH" />
							<ext:TextField ID="Txtfyxh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="FYXH" />
							<ext:TextField ID="Txtypcd" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="YPCD" />
							<ext:TextField ID="Txtdw" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="dw" />
							<ext:TextField ID="Txtfysl" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="FYSL" />
							<ext:TextField ID="Txtzjje" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ZJJE" />
							<ext:TextField ID="Txtysgh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="YSGH" />
							<ext:TextField ID="Txtqrgh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="QRGH" />
							<ext:TextField ID="Txtfyks" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="FYKS" />
							<ext:TextField ID="Txtjfrq" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="JFRQ" />
							<ext:TextField ID="Txtyplx" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="YPLX" />
							<ext:TextField ID="Txtjscs" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="JSCS" />
							<ext:TextField ID="Txtyzxh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="YZXH" />
							<ext:TextField ID="Txtyjrq" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="YJRQ" />
							<ext:TextField ID="Txtzlxz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ZLXZ" />
							<ext:TextField ID="Txtgldm1" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="gldm1" />
							<ext:TextField ID="Txtgldm3" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="gldm3" />

                        </Items>
                    </ext:Panel>
                </Items>
            </ext:FormPanel>
        </Items>
        <Buttons> 
            <ext:Button Text="提交" ID="BtnSave" runat="server" Icon="Disk">
                <DirectEvents>
                    <Click OnEvent="BtnSave_Click">
                        <EventMask ShowMask="true" Msg="正在提交，请等候 ..."  />
                    </Click>
                </DirectEvents>
                <Listeners>
                    <Click Handler="if (#{d50_fymx_MainForm}.getForm().isValid()) {;}else{Ext.Msg.show({icon: Ext.MessageBox.ERROR, msg: '您填写的信息不正确，请您确认！', buttons:Ext.Msg.OK});return false;}" />
                </Listeners>
            </ext:Button>
            <ext:Button Text="取消" ID="BtnConcel" Icon="Delete">
                <Listeners>
                    <Click Handler="#{d50_fymx_Win}.hide();" />
                </Listeners>
            </ext:Button>
        </Buttons>
    </ext:Window>
    </form>
</body>
</html>
